/*
	Created: Jonathan Turner
		On : 10/18/2013
Description: Gets list of adults in same family as specified ID.
	Updates:
*/

ALTER PROCEDURE daycare.GetFamilyAdults @ChildId INT
AS 
  SELECT  adu.AdultId
        , adu.FamilyId
        , adu.FirstName
        , adu.LastName
        , adu.PhoneNumber
        , adu.EmailAddress
        , adu.IsEmergencyContact
        , adu.IsApprovedPickup
        , adu.ImageId
		, adu.IsAuthorizedGuardian
        , adu.FirstName + ' ' + adu.LastName AS FullName
  FROM    daycare.Adults AS adu
  INNER JOIN daycare.Children AS chi ON adu.FamilyId = chi.FamilyId
  WHERE   chi.ChildId = @ChildId
  GO